FROM node:16.17.0  as builder
ARG WORK_DIR=/usr/src/app
COPY . $WORK_DIR
WORKDIR $WORK_DIR
RUN npm config set registry https://registry.npmmirror.com \
  && npm install -g pnpm\
  && pnpm install \
  && pnpm run build
FROM nginx:1.19.8-alpine
COPY --from=builder /usr/src/app/dist/ /usr/share/nginx/html
